<?php if ($pager && $pager->pageCount > 1) { ?>
	<?php if ($scriptFunc) { ?>
		<div class="pager">
			<?php if ($pager->currentPage > 1) : ?>
				<a class="p" href="javascript:;" onclick="<?php echo $scriptFunc ?>(1)">首页</a>
				<a class="p" href="javascript:;" onclick="<?php echo $scriptFunc ?>(<?php echo $pager->currentPage -1 ?>)">上一页</a>
			<?php endif ?>
			<?php
				for ($i = $start; $i <= $end; $i++) {
					echo '<a href="javascript:;" onclick="' . $scriptFunc . '(' . $i . ')" class="p ' . ($i == $pager->currentPage ? 'page_id' : '') . '">' . $i . '</a> ';
				}
			?>
			<?php if ($pager->currentPage < $pager->pageCount) : ?>
				<a class="p" href="javascript:;" onclick="<?php echo $scriptFunc ?>(<?php echo $pager->currentPage + 1 ?>)">下一页</a>
				<a class="p" href="javascript:;" onclick="<?php echo $scriptFunc ?>(<?php echo $pager->pageCount ?>)">末页</a>
			<?php endif ?>
		</div>
	<?php } else { ?>
		<div class="pager">
			<?php if ($pager->currentPage > 1) : ?>
				<a class="p" href="<?php echo $uri . 'page=1' ?>">首页</a>
				<a class="p" href="<?php echo $uri . 'page=' . ($pager->currentPage - 1) ?>">上一页</a>
			<?php endif ?>
			<?php
			for ($i = $start; $i <= $end; $i++) {
				echo '<a href="' . $uri . 'page=' . $i . '" class="p ' . ($i == $pager->currentPage ? 'active' : '') . '">' . $i . '</a> ';
			}
			?>
			<?php if ($pager->currentPage < $pager->pageCount) : ?>
				<a class="p" href="<?php echo $uri . 'page=' . ($pager->currentPage + 1) ?>">下一页</a>
				<a class="p" href="<?php echo $uri . 'page=' . $pager->pageCount ?>">末页</a>
			<?php endif ?>
		</div>
	<?php } ?>
<?php } ?>